// FXCreate.cpp : implementation file
//

#include "stdafx.h"
#include <d3dx9.h>
#include <D3D9.h>

#include "dxutil.h"
#include "d3dutil.h"
#include "d3dfont.h"
#include "D3DEnumeration.h"
#include "DXUtil.h"
#include "D3DEnumeration.h"
#include "D3DSettings.h"

#include "fxtool.h"
#include "FXCreate.h"
#include <AniContainer.h>
#include "Effect.h"
#include "FXDialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFXCreate dialog


CFXCreate::CFXCreate(CWnd* pParent /*=NULL*/)
	: CDialog(CFXCreate::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFXCreate)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CFXCreate::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFXCreate)
	DDX_Control(pDX, IDC_COMBO_FUNC, m_Function);
	//}}AFX_DATA_MAP
	InitCtrlVal();
}


BEGIN_MESSAGE_MAP(CFXCreate, CDialog)
	//{{AFX_MSG_MAP(CFXCreate)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFXCreate message handlers

void CFXCreate::InitCtrlVal()
{
	CEffect		*effect;

//	m_D3DApp = d3dapp;
//	effect = m_D3DApp->m_Effect;

	for( FUNCITER iter=effect->m_FunctionList.begin(); iter != effect->m_FunctionList.end(); ++iter )
		m_Function.AddString( (*iter).c_str() );
	m_Function.SetCurSel(0);

/*	for( iter=effect->m_TextureList.begin(); iter != effect->m_TextureList.end(); ++iter )
		m_Texture.AddString( (*iter).c_str() );
	m_Texture.SetCurSel(0);
*/
}

void CFXCreate::OnOK() 
{
	// TODO: Add extra validation here
//	m_D3DApp->m_Effect->SetFunction( m_Function.GetCurSel() );

//	m_D3DApp->m_FXDlg->m_EffectClass = m_D3DApp->m_Effect;
//	m_D3DApp->m_FXDlg->GetValue();
//	m_D3DApp->m_FXDlg->ShowWindow(SW_SHOW);
	
	CDialog::OnOK();
}
